import { request } from "../request";

export function getSMS(mobile: string) {
    const data = {
        mobile,
        countryCode: "+86",
    };

    return request.post<Common.Empty>("/pts/sms", data, {
        useErrMsg: true,
        successToastMsg: "验证码已发送"
    });
}

export function login(mobile: string, code: string) {
    const data = {
        mobile,
        countryCode: "+86",
        code,
    };
    return request.post<Auth.AuthState>("/pts/business/user/phone", data, {
        useErrMsg: true,
        successToastMsg: "登录成功"
    });
}
